<template>
  <BasicDrawer v-bind="$attrs" @register="registerDrawer" destroyOnClose title="订单管理" :width="drawerWith" :showFooter="false">
    <UserOrderIndex ref="userOrderIndex"></UserOrderIndex>
  </BasicDrawer>
</template>
<script lang="ts" setup>
import { getCurrentInstance, ref, unref } from 'vue';
import { BasicDrawer, useDrawerInner } from '@apps/antd-admin/src/components/drawer';
import UserOrderIndex from '../../../financialManage/order/index.vue';
import { useAppInject } from '@apps/antd-admin/src/hooks/web/use-app-inject';
const { getIsMobile } = useAppInject();
const drawerWith = ref('55%');
if (unref(getIsMobile)) {
  drawerWith.value = '80%';
}
const ctx: any = getCurrentInstance();

const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async data => {
  let record = data.record;
  console.info('record.userId', record.userId);
  ctx.refs['userOrderIndex'].setSearchInfoProps(record.userId);
});
</script>
